<script setup lang="ts">
import { onMounted } from 'vue';
import { WebviewWindow } from '@tauri-apps/api/webviewWindow'

const emit = defineEmits(['loaded']);

onMounted(async () => {
  // 模拟资源加载
  await new Promise(resolve => setTimeout(resolve, 1000));
  
  // 通知加载完成
  emit('loaded');
  
  // 显示主窗口
  const mainWindow =  WebviewWindow.getCurrent()
  await mainWindow.show();
});
</script>

<template>
  <div class="fixed inset-0 flex items-center justify-center bg-base-100">
    <div class="text-center">
      <img src="/app-icon.png" alt="ClipMate" class="w-16 h-16 mx-auto mb-4 animate-bounce">
      <div class="loading loading-dots loading-lg"></div>
    </div>
  </div>
</template> 